﻿<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%option explicit%>
<%
Dim RZ_IN
RZ_IN=1
%>
<!--#include file="../conn.inc.asp" -->
<!--#include file="admin_inc/admin.function.asp" -->
<!--#include file="admin_inc/admin.sqlfunction.asp" -->
<%
checkadmin(4)
dim rs,sql,tag_name,tag_content,tag_type,tag_pre,tag_tag,id,act
act=Trim(request.Form("act"))
id=Trim(request.Form("tag_id"))
tag_name=HTMLEncode(request.Form("tag_name"))
tag_content=Trim(request.Form("result"))
tag_type=Trim(request.Form("tag_type"))
tag_pre=Trim(request.Form("tag_pre"))
tag_tag=Trim(request.Form("tag_tag"))

If act="add" Then 
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "select * from [c_tags]"
rs.open sql,conn,1,3
rs.addnew
rs("tag_name")=tag_name
rs("tag_content")=tag_content
rs("tag_pre")=tag_pre
rs("tag_type")=tag_type
rs("tag_tag")=tag_tag
rs.update
rs.close
set rs=Nothing
End If 
If act="modify" Then 
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "select * from [c_tags] where id="&id
rs.open sql,conn,1,3
rs("tag_name")=tag_name
rs("tag_content")=tag_content
rs("tag_pre")=tag_pre
rs("tag_type")=tag_type
rs("tag_tag")=tag_tag
rs.update
rs.close
set rs=Nothing
End If 

response.redirect("tag_list.asp")
%>
